//
//  CellConfigSetting.m
//  JinganMindCloud
//
//  Created by JinganMac on 2020/6/29.
//  Copyright © 2020 JingAn. All rights reserved.
//

#import "CellConfigSetting.h"
#import "ConfigCellHeader.h"

@implementation CellConfigSetting

+ (NSDictionary *)mj_objectClassInArray{
    return @{@"subConfigData":[CellSubViewsConfigSetting class]};
}

-(CGFloat)frontSpace{
    if (_frontSpace==0.0) {
        return 70.;
    }else return _frontSpace;
}

-(CGFloat)cellBorderWidth{
    if (_cellBorderWidth==0.0) {
        return  2*CC_OnePixel;
    }else return _cellBorderWidth;
}

-(UIEdgeInsets)cellContentEdge{
    if (_sideSpace>0) {
        return UIEdgeInsetsMake(_topSpace, _sideSpace, _bottomSpace, _sideSpace);
    }else return _cellContentEdge;
}

@end

@implementation CellSubViewsConfigSetting
- (NSString *)cDefalutValue{
    if (_cDefalutValue.length==0) {
        return @"--";
    }else return _cDefalutValue;
}

+(CellSubViewsConfigSetting *)creatSubConfigBy:(NSInteger)type subTitle:(NSString *)title keyValue:(NSString *)key{
    CellSubViewsConfigSetting *sub = [CellSubViewsConfigSetting new];
    sub.celltype = type;
    sub.cTitleValue = title;
    sub.cKeyValue = key;
    sub.cDefalutValue = @"--";
    return sub;
}

+(CellSubViewsConfigSetting *)creatAttributeSubBy:(NSString *)hexColor subTitle:(NSString *)title keyValue:(NSString *)key{
    CellSubViewsConfigSetting *sub = [CellSubViewsConfigSetting new];
    sub.celltype = 6;
    sub.cTitleValue = title;
    sub.hexColor = hexColor;
    sub.cKeyValue = key;
    return sub;
}


@end
